<?php

use Illuminate\Database\Seeder;

class articleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $data = [];
        for ($i=0; $i < 100; $i++) { 
        	$tmp = [];
        	$tmp['user_id'] = rand(2,50);
        	$tmp['title'] = str_random(20);
        	$tmp['content'] = str_random(200);
        	$tmp['images'] = '/uploads/default.jpg';
        	$tmp['status'] = '1';
        	$tmp['topic_id'] = rand(1,50);//话题ID
        	$tmp['column_id'] = rand(6,10);//栏目ID
        	$tmp['click'] = rand(10,2000);//点击次数
        	$tmp['discuss'] = rand(10,300);//评论次数
        	$tmp['collection'] = rand(10,300);//收藏次数
        	$tmp['concern'] = rand(10,300);//打赏次数
        	$tmp['created_at'] = date('Y-m-d H:i:s');//创建时间
        	$tmp['updated_at'] = date('Y-m-d H:i:s');//修改时间
        	$data[] = $tmp;
        }
        DB::table('articles')->insert($data);
    }
}
